Skip to content

refactor(theme): retire legacy Rust theme schema - #1403

Merged
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/theme-config-legacy-cleanup
Jul 3, 2026
Merged

refactor(theme): retire legacy Rust theme schema#1403
limityan merged 1 commit into
GCWing:mainfrom
limityan:yanzhn/theme-config-legacy-cleanup

Conversation

@limityan

@limityan limityan commented Jul 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • retire the legacy Rust top-level GUI theme config schema/provider/default export, keeping only a thin theme.id -> themes.current fallback for old config loads/imports and old call paths
  • keep import compatibility raw until manager normalization so old exported files with config.theme.id do not lose their selected theme before deserialization
  • update the theme optimization design doc so Rust owns only theme selection persistence/bootstrap projection while TS/web-ui owns the full theme contract
  • merge low-risk web preset near colors, regenerate generative UI theme prompt snapshots, and keep installer named dark preview backgrounds after product review confirmed adjacent theme-card identity risk

Color governance impact

Metric Before After
web unique colors 345 342
web theme preset unique colors 119 116
web theme preset near pairs 9 5
web specialized near pairs 13 9
installer unique colors 62 62
installer theme preset unique colors 53 53
installer theme preset near pairs 3 3

Compatibility and risk notes

  • Legacy top-level theme payloads are normalized on load/import/save by moving only theme.id into themes.current; other old GUI theme fields are intentionally no longer a public extension contract.
  • dark and light legacy IDs normalize to bitfun-dark and bitfun-light; existing non-empty themes.current is not overridden.
  • The desktop import command now accepts the existing request.configData envelope and forwards raw config JSON to the config manager before GlobalConfig deserialization.
  • terminal.theme remains a terminal ANSI/defaults config field and is not treated as the GUI theme contract.
  • Product review kept Ink Night secondary and installer named dark primary previews because they affect Monaco line highlight / adjacent theme-card recognition.

Verification

  • git diff --check
  • pnpm run theme:color-audit:all
  • pnpm run theme:color-audit:test
  • pnpm run type-check:web
  • pnpm run lint:web
  • pnpm --dir src/web-ui run test:run -- startupThemeBootstrap.test.ts themePresetOutput.test.ts
  • pnpm --dir src/web-ui run test:run
  • pnpm --dir BitFun-Installer run type-check
  • cargo test -p bitfun-core legacy_theme -- --nocapture
  • cargo test -p bitfun-core generated_theme_prompt -- --nocapture
  • cargo check -p bitfun-desktop
  • cargo check --workspace

cargo check/cargo test still report existing warnings in bitfun-services-integrations and bitfun-desktop; this PR does not introduce new Rust warnings in the touched config code.

@limityan
limityan force-pushed the yanzhn/theme-config-legacy-cleanup branch from f325f2e to 2c5954a Compare July 3, 2026 09:08
Remove the legacy top-level GUI theme config provider while preserving theme.id as a thin fallback to themes.current.

Tighten theme color governance baselines after low-risk web and installer preset near-color merges.
@limityan
limityan force-pushed the yanzhn/theme-config-legacy-cleanup branch from 2c5954a to 0e92660 Compare July 3, 2026 09:42
@limityan
limityan marked this pull request as ready for review July 3, 2026 10:20
@limityan
limityan merged commit c827291 into GCWing:main Jul 3, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant